//
//  ViewUtils.m
//  musicPlayer
//
//  Created by 康迂峰 on 14-4-29.
//  Copyright (c) 2014年 yufeng. All rights reserved.
//

#import "ViewUtils.h"

@implementation ViewUtils

//替换原始的返回样式
+(UIBarButtonItem *)getUIBarButtonItem:(UIImage *)image target:(id)target action:(SEL)action {
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    leftButton.frame = CGRectMake(0, 0, 17, 17);
    [leftButton setBackgroundImage:image
                          forState:UIControlStateNormal];
    
    [leftButton addTarget:target
                   action:action
         forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *item = [[UIBarButtonItem alloc]
                             initWithCustomView:leftButton];
    
    return item;

}

@end
